#ifndef SOURCEFRAMEMODEL_H
#define SOURCEFRAMEMODEL_H

#include <QObject>
#include <QAbstractListModel>
#include "plistparser.h"
#include "CommonMarcro.h"


class SourceFrameModel : public QAbstractListModel
{
    Q_OBJECT
public:
    explicit SourceFrameModel(PlistParser* PlistParser, QObject *parent = 0);
    ~SourceFrameModel();

    QVariant data(const QModelIndex &index, int role) const;
    Qt::ItemFlags flags(const QModelIndex &index) const;
    QVariant headerData(int section, Qt::Orientation orientation,
                                int role = Qt::DisplayRole) const;

    int rowCount(const QModelIndex &parent = QModelIndex()) const;
    int columnCount(const QModelIndex &parent = QModelIndex()) const;

    PlistFrameInfo* getInfoData(QModelIndex& index);

private:
    bool isValidIndex(QModelIndex index) const;

signals:
    
public slots:
    void dataChangeUpdate();

private:
    PlistParser*  m_plistParser;
private:
    static const int MAX_COLUMN_NUM;
    
};

#endif // SOURCEFRAMEMODEL_H
